<?php 
if(!defined('ADMIN')){
	exit('Access Denied');
}
?>
<form id="pagerForm" method="post" action="#rel#">
	<input type="hidden" name="pageNum" value="<?=$page?>" />
	<input type="hidden" name="numPerPage" value="<?=$pagesize?>" />
	<input type="hidden" name="orderField" value="<?=$orderField?>" />
	<input type="hidden" name="orderDirection" value="<?=$orderDirection?>" />
</form>
<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="<?=u(MOD,'list',array('q'=>$q,'mtype'=>$mtype))?>" method="post">
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label>菜品名称：</label>
				<input type="text" name="q" value="<?=$q?>" style="width:200px"  />
			</li>
			<li>
            <?=select($catlist,$pcate,'pcate')?>
            <button type="submit">查询</button>
			</li>
		</ul>

	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<?=u(MOD,'addedi')?>" target="navTab" rel="addedipage88"><span>新增菜品</span></a></li>
			<li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids[]" href="<?=u(MOD,'del')?>" class="delete"><span>批量删除</span></a></li>
			<li class="line">line</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="118">
		<thead>
			<tr>
				<th width="25"><input type="checkbox" group="ids[]" class="checkboxCtrl"></th>
				<th width="50" orderField="id" <? if($orderField=="id"){?>class="<?=$orderDirection?>"<?}?>>ID</th>
				
                <th width="150">菜品类别</th>
                <th orderField="title" <? if($orderField=="title"){?>class="<?=$orderDirection?>"<?}?>>菜品名称</th>
				<th width="120" align="center" orderField="productprice" <? if($orderField=="productprice"){?>class="<?=$orderDirection?>"<?}?>>最新价格</th>
				<th width="120" align="center" orderField="marketprice" <? if($orderField=="marketprice"){?>class="<?=$orderDirection?>"<?}?>>促销价格</th>

                <th width="50" align="center" orderField="displayorder" <? if($orderField=="displayorder"){?>class="<?=$orderDirection?>"<?}?>>排序</th>
				<th width="200">操作</th>
			</tr>
		</thead>
        <tbody>
        <?php foreach ($row as $r){?>
		<tr target="id" rel="<?=$r["id"]?>">
				<td class="center"><input name="ids[]" value="<?=$r["id"]?>"  <?php if($r['sys']==1){?>title="系统数据，不准删除"  disabled="disabled"<?php }?> type="checkbox" /></td>
				<td class="center"><?=$r["id"]?></td>
				
                <td class="center"><?=$catlisttemp[$r["pcate"]]["name"]?></td>
                
                <td><?=$r["title"]?></td>
    			<td class="center"><?=number_format($r["productprice"],2)?></td>
				<td class="center"><? if($r["marketprice"]>0){ echo $r["marketprice"];}else{ echo $r["productprice"];} ?></td>
				<td class="center"><?=$r["displayorder"]?></td>
				<td class="center">
					<a title="删除" target="ajaxTodo" href="<?=u(MOD,'del',array('id'=>$r['id']))?>" class="btnDel">删除</a>

					<a title="修改菜品" target="navTab" rel="addedipage88" href="<?=u(MOD,'addedi',array('id'=>$r['id']))?>" class="btnEdit">编辑</a>
				</td>
		</tr>
        <?php }?>   
		</tbody>
	</table>            
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})" id="PageSize">
				<option value="20" <? if($pagesize==20){ echo 'selected="true"';}?>>20</option>
				<option value="50" <? if($pagesize==50){ echo 'selected="true"';}?>>50</option>
				<option value="100" <? if($pagesize==100){ echo 'selected="true"';}?>>100</option>
				<option value="200" <? if($pagesize==200){ echo 'selected="true"';}?>>200</option>
			</select>
			<span>条，共<?php echo $total;?>条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="<?php echo $total;?>" numPerPage="<?=$pagesize?>" pageNumShown="10" currentPage="<?=$page?>"></div>

	</div>
</div>    
